package cn.kgc.ssm.service;



import cn.kgc.ssm.dao.BackendUserMapper;
import cn.kgc.ssm.pojo.BackendUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author yxp
 * @create 2021-05-19 16:56
 */
@Service
public class BackendUserServiceImpl implements BackendUserService {
    @Resource
    private BackendUserMapper mapper;


    @Override
    public BackendUser login(String userCode, String userPassword) throws Exception {
        BackendUser backendUser=null;
        backendUser = mapper.getLoginUser(userCode);
        if (backendUser!=null){
            if (backendUser.getUserPassword().equals(userPassword)){
                return backendUser;
            }else{
                backendUser=null;
            }
        }
            return backendUser;
    }
}
